package system;

import java.util.Date;

import db.DBObject;

public class Book implements DBObject {
	long id;
	String name;
	String isbn;
	String author;
	String press;
	String description;
	String catagory;
	Date publish_date;
	double price;
	int count;
	
	Book() {
	}
	
	public Book(String name, String isbn, String author,
			String press, String description, String catagory,
			Date publish_date, double price, int count) {
		this.name = name;
		this.isbn = isbn;
		this.author = author;
		this.press = press;
		this.description = description;
		this.catagory = catagory;
		this.publish_date = publish_date;
		this.price = price;
		this.count = count;
	}
	
	@Override
	public long getId() {
		return id;
	}
	
	public String getName() {
		return name;
	}

	public String getIsbn() {
		return isbn;
	}

	public String getAuthor() {
		return author;
	}

	public String getPress() {
		return press;
	}

	public String getDescription() {
		return description;
	}

	public String getCatagory() {
		return catagory;
	}

	public Date getPublish_date() {
		return publish_date;
	}

	public double getPrice() {
		return price;
	}

	public int getCount() {
		return count;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	public void setIsbn(String isbn) {
		this.isbn = isbn;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public void setPress(String press) {
		this.press = press;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public void setCatagory(String catagory) {
		this.catagory = catagory;
	}

	public void setPublish_date(Date publish_date) {
		this.publish_date = publish_date;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public void setCount(int count) {
		this.count = count;
	}

	@Override
	public boolean equals(Object pObject) {
		if (pObject instanceof Book) {
			return ((Book) pObject).id == this.id;
		}
		return false;
	}

	@Override
	public int hashCode() {
		return (int) id;
	}
}
